<div id="comments">

<?php

if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!');

if (post_password_required()) {
	echo '<p class="nocomments">This post is password protected. Enter the password to view comments.</p>';
	return;
}

?>

<div id="comments-list" class="comments">
<?php if (have_comments()) : ?>

	<?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>
		<div id="nav-comments" class="navigation">
			<div class="nav-previous"><?php previous_comments_link('&laquo; Older comments'); ?></div>
			<div class="nav-next"><?php next_comments_link('Newer comments &raquo;'); ?></div>
		</div>
	<?php endif; // check for comment navigation ?>

	<h3><?php comments_number('No Responses', 'One Response', '% Responses' ); ?></h3>
	<p>Subscribe to comments with <?php post_comments_feed_link('RSS'); if (pings_open()) { ?>, or <a href="<?php trackback_url() ?>" rel="trackback">TrackBack</a> to '<?php the_title(); ?>'<?php } // endif pings_open() ?>.</p>
	<ul class="commentlist"><?php wp_list_comments(); ?></ul>

<?php elseif (!is_page()) : ?>

	<?php if (pings_open() && !comments_open()) : ?>
		<p class="nocomments">Comments are closed, but <a href="<?php trackback_url() ?>" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.</p>
	<?php elseif (!comments_open()) : ?>
		<p class="nocomments">Comments are closed.</p>
	<?php endif; ?>

<?php endif; ?>
</div>

<?php comment_form(); ?>

</div>